package routers

import (
	"CMETO/controllers/courseController"
	middleware "CMETO/middlewares"

	"github.com/gin-gonic/gin"
)

func CourseApi(r *gin.RouterGroup) {
	var courseType courseController.CourseTypeController
	courseTypeRouter := r.Group("/courseType", middleware.JWTAuthPlus())
	{
		courseTypeRouter.GET("/", courseType.QueryCourseTypes)
		courseTypeRouter.POST("/", courseType.AddCourseType)
		courseTypeRouter.PUT("/", courseType.UpdateCourseType)
		courseTypeRouter.DELETE("/", courseType.DeleteCourseType)
	}
	var course courseController.CourseController
	courseRouter := r.Group("/course", middleware.JWTAuthPlus())
	{
		courseRouter.GET("/", course.QueryCourses)
		courseRouter.POST("/", course.AddCourse)
		courseRouter.PUT("/", course.UpdateCourse)
		courseRouter.DELETE("/", course.DeleteCourse)
	}
}
